/**
 * 
 */
package com.sci.web.action.eninfomanager;

import javax.annotation.Resource;

import com.sci.web.action.util.BaseAction;
import com.sci.web.dao.EnterpriseInfoManageDao;

/**
 * @author  BaiFuyou
 * @date: Oct 28, 2011 3:22:50 PM
 */
public class PassCheckEnterpriseUserAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3833359807893296651L;
	@Resource
	private EnterpriseInfoManageDao enterpriseInfoManageDao;
	private int userid ;
	/**
	 * flag = 1(审核通过) flag=0(审核不通过)
	 */
	private int flag;
	/**
	 * @return the flag
	 */
	public int getFlag() {
		return flag;
	}
	/**
	 * @param flag the flag to set
	 */
	public void setFlag(int flag) {
		this.flag = flag;
	}
	/**
	 * @return the userid
	 */
	public int getUserid() {
		return userid;
	}
	/**
	 * @param userid the userid to set
	 */
	public void setUserid(int userid) {
		this.userid = userid;
	}
	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		super.setContentType(super.JSON);
		/**
		 * 审核通过
		 */
		if(flag == 1){
			if(enterpriseInfoManageDao.passCheckEnterprseUser(userid)){
				super.outPrint("ok");
			}else{
				super.outPrint("fail");
			}
		}
		/**
		 * 审核不通过
		 */
		if(flag == 0){
			if(enterpriseInfoManageDao.notPassCheckEnterpriseUser(userid)){
				super.outPrint("ok");
			}else{
				super.outPrint("fail");
			}
		}
		return "json";
	}

}
